const Router = require('koa-router');
const router =new Router({ prefix: '/api/v1' });

router.get('/',(ctx)=>{
    ctx.body = "首页"
})

router.get('/list',async(ctx)=>{
    console.log('sssssss')
    let list = {
        name: '张三',
        h: '<h2>这是一个h2</h2>',
        num: 20,
        data: ['11111', '22222', '33333']
    }
    await ctx.render('index',{
        list
    })
})

router.get('/detail/:id',(ctx)=>{
    ctx.body = "首页列表吧"
})

module.exports = router